package com.hm.cms.api;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.hm.cms.auto.su.ControllerResult;
import com.hm.cms.auto.su.R;
import com.hm.cms.service.api.TermApiTaxonomyService;
import com.hm.common.su.bean.ServerResponse;

import io.swagger.annotations.ApiOperation;

/**
 * @author shishun.wang
 * @date 2017年12月4日 下午12:03:47
 * @version 1.0
 * @describe
 */
@ResponseBody
@RestController
@RequestMapping(R.Restful.API + "/static")
public class StaticApi {

	@Autowired
	private TermApiTaxonomyService termApiTaxonomyService;

	private static final String SWWAGER_TAG = "静态化内容管理";
	
	@RequestMapping(value = "/home", method = RequestMethod.PATCH)
	@ApiOperation(tags = SWWAGER_TAG, value = "静态化首页", httpMethod = "PATCH", notes = "静态化首页,返回静态化结果")
	public ResponseEntity<ServerResponse<Boolean>> staticHome() {
		termApiTaxonomyService.staticHomePage();
		return ControllerResult.success(true);
	}

	@RequestMapping(value = "/termTaxonomy", method = RequestMethod.PATCH)
	@ApiOperation(tags = SWWAGER_TAG, value = "静态化标签", httpMethod = "PATCH", notes = "静态化标签,返回静态化结果")
	public ResponseEntity<ServerResponse<Boolean>> staticTermTaxonomy() {
		termApiTaxonomyService.staticTermTaxonomy();
		return ControllerResult.success(true);
	}

}
